/*
 * Copyright 2010 Christoph Widulle (christoph.widulle@googlemail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */



package com.android1.amarena2d.nodes.behavior.delegates;

import com.android1.amarena2d.input.TouchListener;
import com.android1.amarena2d.input.TouchSpot;

public interface TouchDelegate<T extends TouchSpot> {

    /**
     * Creates a touchspot for the touchable entity with the given priority.
     * It will register itself to the TouchSpotSystem.
     *
     * @param priority defines the order of execution in the TouchSpotSystem.
     * @return returns the created and registered TouchSpot.
     */
    public TouchDelegate<T> makeTouchable(int priority, TouchListener listener);

    /**
     * Creates a touchspot for the touchable entity with lowest priority.
     * It will register itself to the TouchSpotSystem.
     *
     * @return returns the created and registered TouchSpot.
     */
    public TouchDelegate<T> makeTouchable(TouchListener listener);


    public TouchListener addListener(TouchListener listener);

    public void removeListener(TouchListener listener);

    /**
     * Unregisteres the TouchSpot and sets it to null.
     */
    public void revokeTouchable();

    /**
     * Returns the TouchSpot registered for the Touchable Entity at the TouchSpotSystem.
     *
     * @return the associated TouchSpot
     */
    public T getTouchspot();

    /**
     * The TouchSpot remains registered but will be ignored by the TouchSpotSystem.
     */
    public void pause();

    /**
     * Resumes the paused TouchSpot.
     */
    public void resume();

    public boolean isPaused();

    public boolean isActive();

    public TouchDelegate setTranslateToWorld();

    public TouchDelegate setTranslateToScreen();

    public TouchDelegate setNotifyNoHit(boolean notifyNoHit);

    public boolean isNotifyNoHit();

    public boolean isAlwaysNotifyAllListener();

    public TouchDelegate setAlwaysNotifyAllListener(boolean notifyAllListener);


}
